import request from '@ey-utils/utils/services/request';
import api from '../api';
/**
 *  King
 */
export const createMCate = async (values: any) => {
  return await request(api.metaCateCreate, {
    method: 'post',
    data: values
  }).then(res => {
    return res;
  });
};


export const detailMCate = async (code: string) => {
  return await request(api.metaCateDetail, {
    method: 'get',
    params: { code, }
  }).then(res => {
    return res;
  });
};

export const updateMCate = async (values: any) => {
  return await request(api.metaCateUpdate, {
    method: 'post',
    data: values
  }).then(res => {
    return res;
  });
};

export const removeMCate = async (code: string) => {
  return await request(api.metaCateRemove, {
    method: 'get',
    params: { code, }
  }).then(res => {
    return res;
  });
};
export const listMetaCate = async () => {
  return await request(api.metaCateList, {
    method: 'get',
  }).then(res => {
    return res;
  });
};
export const treeMetaCate = async (includeMeta?: any) => {
  return await request(api.metaCateTree, {
    method: 'get',
    params: { includeMeta }
  }).then(res => {
    return res;
  });
};
